package org.flow.basic.doubts.trecord;

import java.util.Date;

/**
 * @author xl-9527
 * @since 2024/8/16
 */
public record Person(String name, Integer age, Date birthday) {

	public Person {
		if (name == null) {
			throw new IllegalArgumentException("name is null");
		}
		if (age == null) {
			throw new IllegalArgumentException("age is null");
		}
	}

	public Person(String name) {
		this(name, 0, null);
	}

	public static Person doGetPerson() {
		return new Person("xl-9527", 18, null);
	}
}
